package com.orion.config;

import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.web.authentication.WebAuthenticationDetails;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * 上面提到CustomWebAuthenticationDetails 需要通过HttpServletRequest获取到用户输入的验证码的信息。
 * AuthenticationDetailsSource类就是初始化CustomWebAuthenticationDetails类的地方，
 * 在这里面我们需要将HttpServletRequest传递到CustomAuthenticationDetailsSource中。
 *
 * @author Administrator
 * @date 2021/9/11
 */
//@Component("customAuthenticationDetailsSource")
public class CustomAuthenticationDetailsSource implements AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails>  {
    @Override
    public WebAuthenticationDetails buildDetails(HttpServletRequest request) {
        return new CustomWebAuthenticationDetails(request);
    }
}
